package com.bm.server.controller;

import com.bm.common.dto.RoomUerDto;
import com.bm.common.vo.R;
import com.bm.server.service.intf.RoomUserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * YoungMan, may the force be with you.
 *
 * @Author: 吃个小布丁吧
 * @Date: 2022/07/21/8:35
 */
@RestController
@RequestMapping("/server/roomuser/")
public class RoomUserController {
    @Resource
    private RoomUserService service;
    @GetMapping("select.do")
    public R select (@RequestParam("roomid")int roomid){
        return service.select(roomid);
    }
    @PostMapping("insert.do")
    public R insert (@RequestBody RoomUerDto dto){
        return service.insert(dto);
    }
    @PostMapping("del.do")
    public R del(@RequestParam Integer uid,@RequestParam Integer roomid){
        return service.del(uid, roomid);
    }
    @PostMapping("randm.do")
    public R randm(){
        return service.randm();
    }
    @PostMapping("gettwo.do")
    public R getTwo(@RequestParam Integer uid,@RequestParam Integer roomid){
        return service.getTwo(uid, roomid);
    }
    @PostMapping("getfour")
    public R getfour(@RequestParam Integer uid,@RequestParam Integer roomid){
        return service.getfour(uid, roomid);
    }
    @PostMapping("play.do")
    public R play(@RequestParam Integer uid){
        return service.play(uid);
    }

}
